package com.xcode.xandrdb.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 数据库表的注解
 * @author xiaolei
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Table
{
	public String value() default "";
	
	/**
	 * 标记为主键
	 * @author 肖蕾
	 */
	@Target(ElementType.FIELD)
	@Retention(RetentionPolicy.RUNTIME)
	public static @interface PRIMARY_KEY{}
	
	/**
	 * 标记为自增长
	 * @author 肖蕾
	 */
	@Target(ElementType.FIELD)
	@Retention(RetentionPolicy.RUNTIME)
	public static @interface AUTOINCREMENT{}
	
	/**
	 * 标记不为空
	 * @author 肖蕾
	 */
	@Target(ElementType.FIELD)
	@Retention(RetentionPolicy.RUNTIME)
	public static @interface NOT_NULL{}
	
	/**
	 * 项的类型
	 * @author 肖蕾
	 */
	@Target(ElementType.FIELD)
	@Retention(RetentionPolicy.RUNTIME)
	public static @interface Type
	{
		/**
		 * int类型的项
		 * @author 肖蕾
		 */
		@Target(ElementType.FIELD)
		@Retention(RetentionPolicy.RUNTIME)
		public static @interface INTEGER{}
		/**
		 * 字符串类型的项
		 * @author 肖蕾
		 */
		@Target(ElementType.FIELD)
		@Retention(RetentionPolicy.RUNTIME)
		public static @interface TEXT{}
		
	}
	
	
	
	
}
